<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>SOP</title>
<link href="resources/styles/main.css" rel="stylesheet" type="text/css" />
<link type="text/css" href="resources/scripts/jquery-ui-1.8.14.custom/css/start/jquery-ui-1.8.14.custom.css" rel="stylesheet" />
<script type="text/javascript" src="resources/scripts/jquery-ui-1.8.14.custom/js/jquery-1.5.1.min.js"></script>
<script type="text/javascript" src="resources/scripts/jquery-ui-1.8.14.custom/js/jquery-ui-1.8.14.custom.min.js"></script>
<script type="text/javascript" src="resources/scripts/jquery-ui-1.8.14.custom/js/jquery.blockUI.js"></script>
<script type="text/javascript" src="resources/scripts/jquery.blockUI.js"></script>
<script type="text/javascript" src="resources/scripts/datepicker-CN.js"></script>
<script type="text/javascript">

//检查用户名
function checkUsername(username)
{
	var reg = /^[a-zA-Z0-9_]+$/;
	return reg.test(username);
}

var selected01 = -1;
var selected02 = -1;
var selectedTerm = -1;

$(document).ready(function(){
	$('.table_eachline').mouseover(function(){
			$(this).find('td').css('background', '#DEDEDE');
		});
	
	$('.table_eachline').mouseout(function(){
			$(this).find('td').css('background', '#FFFFFF');
		});
	
	$('#addConfig01').dialog({ 
		autoOpen: false,
		buttons: {
				"提交": function() {
						if($('#config01value').val()=='')
						{
							$('#errMsgAddConfig01').html('不能为空');
							return;
						}
						$('#errMsgAddConfig01').html('<span style="color: green;"></span>');
						$.blockUI({message:'正在提交，请稍候...'});
						$.post(
							'<!--{spUrl c=unit_super a=addConfig01}-->',
							{
								'value': $('#config01value').val(),
								'id' : selected01
							},
							function(data) {
								$.unblockUI();
								if(data == -1)
								{
									$('#errMsgAddConfig01').html('提交出现错误，请稍候重试。');
									return;
								}
								else
									window.location.reload();
							}
						);
					},
				"关闭": function() {
						$(this).dialog('close');
					}
			}
		});
		
		$('#del01Confirm').dialog({ 
		autoOpen: false,
		buttons: {
				"是": function() {
						$.blockUI({message:'正在提交，请稍候...'});
						$.post(
							'<!--{spUrl c=unit_super a=del01}-->',
							{
								'id' : selected01
							},
							function(data) {
								$.unblockUI();
								if(data == -1)
								{
									alert('提交出现错误，请稍候重试。');
									return;
								}
								else
									window.location.reload();
							}
						);
					},
				"否": function() {
						$(this).dialog('close');
					}
			}
		});
		
		$('#repwdMy').dialog({ 
		autoOpen: false,
		buttons: {
				"提交": function() {
						if(!checkUsername($('#oldpwdMy').val()))
						{
							$('#errMsgRepwdMy').html('密码不能为空');
							return;
						}
						if(!(checkUsername($('#repwdInputMy').val())))
						{
							$('#errMsgRepwdMy').html('密码不能为空');
							return;
						}
						if($('#repwdInputMy').val() != $('#repwdInputConfirmMy').val())
						{
							$('#errMsgRepwdMy').html('密码和确认密码不一致');
							return;
						}
						$('#errMsgRepwdMy').html('<span style="color: green;"></span>');
						$.blockUI({message:'正在提交，请稍候...'});
						$.post(
							'<!--{spUrl c=main a=changeMyPwd}-->',
							{
								'oldpwd': $('#oldpwdMy').val(),
								'pwd': $('#repwdInputMy').val(),
								'selectedUser' : "<!--{$user.id}-->"
							},
							function(data) {
								$.unblockUI();
								if(data == -1)
								{
									$('#errMsgRepwdMy').html('密码错误');
									return;
								}
								else
								{
									alert('密码修改成功');
									window.location.reload();
								}
							}
						);
					},
				"关闭": function() {
						$(this).dialog('close');
					}
			}
		});
		
		$('.repwdLinkMy').click(function(){
			$('#repwdMy').dialog('open');
			return false;
		});
	
		$('.add01').click(function(){
			selected01 = -1;
			$('#addConfig01').dialog('open');
			return false;
		});
		
		$('.edit01').click(function(){
			selected01 = $(this).attr('rel');
			$('#config01value').val($(this).attr('value'));	
			$('#addConfig01').dialog('open');
			return false;	
		});
		
		$('.del01').click(function(){
			selected01 = $(this).attr('rel');
			$('#del01Confirm').dialog('open');
			return false;	
		});
		
		
		
	$('#addConfig02').dialog({ 
		autoOpen: false,
		buttons: {
				"提交": function() {
						if($('#config02value').val()=='')
						{
							$('#errMsgAddConfig02').html('不能为空');
							return;
						}
						$('#errMsgAddConfig02').html('<span style="color: green;"></span>');
						$.blockUI({message:'正在提交，请稍候...'});
						$.post(
							'<!--{spUrl c=unit_super a=addConfig02}-->',
							{
								'value': $('#config02value').val(),
								'cates': $('#config02cates').val(),
								'attr_1': $('#config02attr1').val(),
								'attr_2': $('#config02attr2').val(),
								'id' : selected02
							},
							function(data) {
								$.unblockUI();
								if(data == -1)
								{
									$('#errMsgAddConfig02').html('提交出现错误，请稍候重试。');
									return;
								}
								else
									window.location.reload();
							}
						);
					},
				"关闭": function() {
						$(this).dialog('close');
					}
			}
		});
		
		$('#del02Confirm').dialog({ 
		autoOpen: false,
		buttons: {
				"是": function() {
						$.blockUI({message:'正在提交，请稍候...'});
						$.post(
							'<!--{spUrl c=unit_super a=del02}-->',
							{
								'id' : selected02
							},
							function(data) {
								$.unblockUI();
								if(data == -1)
								{
									alert('提交出现错误，请稍候重试。');
									return;
								}
								else
									window.location.reload();
							}
						);
					},
				"否": function() {
						$(this).dialog('close');
					}
			}
		});
		
		
		
		$('.add02').click(function(){
			selected02 = -1;
			$('#addConfig02').dialog('open');
			return false;
		});
		
		$('.edit02').click(function(){
			selected02 = $(this).attr('rel');
			$('#config02value').val($(this).attr('value'));	
			$('#config02cates').val($(this).attr('cates'));
			$('#config02attr1').val($(this).attr('attr1'));	
			$('#config02attr2').val($(this).attr('attr2'));	
			$('#addConfig02').dialog('open');
			return false;	
		});
		
		$('.del02').click(function(){
			selected02 = $(this).attr('rel');
			$('#del02Confirm').dialog('open');
			return false;	
		});
		
			
		
	$('#addTerm').dialog({ 
		autoOpen: false,
		buttons: {
				"提交": function() {
						if($('#termname').val()=='')
						{
							$('#errMsgAddTerm').html('不能为空');
							return;
						}
						$('#errMsgAddTerm').html('<span style="color: green;"></span>');
						$.blockUI({message:'正在提交，请稍候...'});
						$.post(
							'<!--{spUrl c=unit_super a=addTerm}-->',
							{
								'termname': $('#termname').val(),
								'cfrom': $('#from').val(),
								'cto': $('#to').val(),
								'id' : selectedTerm
							},
							function(data) {
								$.unblockUI();
								if(data == -1)
								{
									$('#errMsgAddTerm').html('提交出现错误，请稍候重试。');
									return;
								}
								else
									window.location.reload();
							}
						);
					},
				"关闭": function() {
						$(this).dialog('close');
					}
			}
		});
		
		$('#delTermConfirm').dialog({ 
		autoOpen: false,
		buttons: {
				"是": function() {
						$.blockUI({message:'正在提交，请稍候...'});
						$.post(
							'<!--{spUrl c=unit_super a=delTerm}-->',
							{
								'id' : selectedTerm
							},
							function(data) {
								$.unblockUI();
								if(data == -1)
								{
									alert('提交出现错误，请稍候重试。');
									return;
								}
								else
									window.location.reload();
							}
						);
					},
				"否": function() {
						$(this).dialog('close');
					}
			}
		});
		
		
		
		$('.addTerm').click(function(){
			selectedTerm = -1;
			$('#addTerm').dialog('open');
			return false;
		});
		
		$('.editTerm').click(function(){
			selectedTerm = $(this).attr('rel');
			$('#termname').val($(this).attr('value'));	
			$('#from').val($(this).attr('from'));	
			$('#to').val($(this).attr('to'));	
			$('#addTerm').dialog('open');
			return false;	
		});
		
		$('.delTerm').click(function(){
			selectedTerm = $(this).attr('rel');
			$('#delTermConfirm').dialog('open');
			return false;	
		});
		
		
	$( "#from" ).datepicker();
	
	$( "#to" ).datepicker();
		
});
</script>


<style>
div.ui-datepicker{
 font-size:10px;
}
</style>



</head>

<body>
<div id="addConfig01" style="width: 320px; height: 240px; display:none;">
  <form method="POST">
    <table>
      <tr>
      	<td colspan="2"><span style="color: #900; " id="errMsgAddConfig01"></span></td>
      </tr>
      <tr>
        <td>教育目的内容：</td>
        <td><input id="config01value" type="text" name="config01value"/></td>
      </tr>
    </table>
  </form>
</div>

<div id="addConfig02" style="width: 320px; height: 240px; display:none;">
  <form method="POST">
    <table>
      <tr>
      	<td colspan="2"><span style="color: #900; " id="errMsgAddConfig02"></span></td>
      </tr>
      <tr>
        <td>活动类型内容：</td>
        <td><input id="config02value" type="text" name="config02value"/></td>
      </tr>
      <tr>
        <td>教育目的：</td>
        <td><input id="config02cates" type="text" name="config02cates"/></td>
      </tr>
      <tr>
        <td>属性1：</td>
        <td><input id="config02attr1" type="text" name="config02attr1"/></td>
      </tr>
      <tr>
        <td>属性2：</td>
        <td><input id="config02attr2" type="text" name="config02attr2"/></td>
      </tr>
    </table>
  </form>
</div>

<div id="addTerm" style="width: 320px; height: 240px; display:none;">
  <form method="POST">
    <table>
      <tr>
      	<td colspan="2"><span style="color: #900; " id="errMsgAddTerm	"></span></td>
      </tr>
      <tr>
        <td>学期名：</td>
        <td><input id="termname" type="text" name="termname"/></td>
      </tr>
      <tr>
        <td>起始日期：</td>
        <td><input id="from" type="text" name="from"/></td>
      </tr>
      <tr>
        <td>结束日期：</td>
        <td><input id="to" type="text" name="to"/></td>
      </tr>
    </table>
  </form>
</div>

<div id="del01Confirm" style="width: 320px; height: 240px; display:none;">
  <p>确认删除？</p>
</div>

<div id="del02Confirm" style="width: 320px; height: 240px; display:none;">
  <p>确认删除？</p>
</div>

<div id="delTermConfirm" style="width: 320px; height: 240px; display:none;">
  <p>确认删除？</p>
</div>

<div id="repwdMy" style="width: 320px; height: 240px; display:none;">
  <form method="POST">
    <table>
      <tr>
      	<td colspan="2"><span style="color: #900; " id="errMsgRepwdMy"></span></td>
      </tr>
      <tr>
        <td>旧密码：</td>
        <td><input id="oldpwdMy" type="password" name="oldpwdMy"/></td>
      </tr>
      <tr>
        <td>新密码：</td>
        <td><input id="repwdInputMy" type="password" name="repwdInputMy" /></td>
      </tr>
      <tr>
        <td>重复新密码：</td>
        <td><input id="repwdInputConfirmMy" type="password" name="repwdInputConfirmMy" /></td>
      </tr>
    </table>
  </form>
</div>
<table width="100%" height="316" border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td>&nbsp;</td>
  </tr>
</table>
<table border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td height="63" valign="top" background="resources/images/bgc10.gif" style="padding:30px 0px 0px 35px"><table width="93%" border="0" cellspacing="0" cellpadding="0">
        <tr>
          <td><table border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td bgcolor="#8ac281" class="b06">超级管理员管理页面</td>
                <td><img src="resources/images/bgc11.gif" width="26" height="52" /></td>
              </tr>
            </table></td>
          <td align="right"><table width="100%" border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td height="23" align="right"><span class="b05"> 您好， </span><span class="b07">超级管理员</span><span class="b05"> 上次登录：</span><span class="b16"><!--{$user.last_login_date}--> </span><span class="b05">[<a href="<!--{spUrl c=main a=logout}-->">安全登出</a>]  [<a href="#" class="repwdLinkMy">密码修改</a>] </span></td>
              </tr>
            </table></td>
        </tr>
      </table></td>
  </tr>
  <tr>
    <td background="resources/images/bgc02.gif"><table width="90%" border="0" align="center" cellpadding="0" cellspacing="0" style="margin-top:5px">
        <tr>
          <td height="40" colspan="2"><img src="resources/images/bgc05.gif" align="absmiddle" /><span class="b01">学校管理</span></td>
        </tr>
        <tr>
          <td width="56%" height="1" background="resources/images/bgc04.gif"></td>
          <td width="44%" background="resources/images/bgc04.gif"></td>
        </tr>
      </table>
      <table width="90%" border="0" align="center" cellpadding="0" cellspacing="0" background="resources/images/bgc08.gif" style="margin:25px auto 15px auto">
        <tr>
          <td height="32" style="padding-left:15px"><table border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td><table border="0" cellpadding="0" cellspacing="0" class="b03" >
                    <tr>
                      <td><a href="<!--{spUrl c=unit_super a=index}-->">学校管理</a></td>
                    </tr>
                  </table></td>
                <td><table border="0" cellpadding="0" cellspacing="0" class="b02">
                    <tr>
                      <td><a href="#">相关设置</a></td>
                    </tr>
                  </table></td>
              </tr>
            </table></td>
        </tr>
      </table>
      <table width="90%" border="0" align="center" cellpadding="0" cellspacing="0">
        <tr> </tr>
      </table>
      <table border="0" align="center" cellpadding="0" cellspacing="0" style="margin:15px auto 25px auto">
        <tr>
          <td><img src="resources/images/ke15.gif" width="864" height="5" /></td>
        </tr>
        
        
        <tr>
          <td>
          <span style="font-size: 14px; font-weight: bold; color: #066;">学期管理：</span>
          <table width="864" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#dfdfdf" >
              <tr>
                <td width="856" align="center" bgcolor="#FFFFFF"><table width="95%" border="0" align="center" cellpadding="3" cellspacing="1" bgcolor="#DDDDDD"  style=" margin:20px;">
                    <tr>
                      <td height="25" width="100" align="center" bgcolor="#f7f7f7" class="b05">学期编号</td>
                      <td width="300" align="center" bgcolor="#f7f7f7" class="b05">学期名字</td>
                      <td width="150" align="center" bgcolor="#f7f7f7" class="b05">起始日期</td>
                      <td width="150" align="center" bgcolor="#f7f7f7" class="b05">结束日期</td>
                      <td width="280" align="center" bgcolor="#f7f7f7" class="b05">选择操作</td>
                    </tr>
                    <!--{foreach from=$terms item=one}-->
                    <tr class="table_eachline">
                      <td height="30" align="center" bgcolor="#FFFFFF" class="b12"><!--{$one.id}--></td>
                      <td bgcolor="#FFFFFF" class="b15"><input readonly="readonly" name="rename_user" value="<!--{$one.termname}-->" type="text" class="b11" id="textfield3" size="20" /></td>
                      
                      <td bgcolor="#FFFFFF" class="b15"><input readonly="readonly" name="rename_user" value="<!--{$one.cfrom}-->" type="text" class="b11" id="textfield3" size="20" /></td>
                      <td bgcolor="#FFFFFF" class="b15"><input readonly="readonly" name="rename_user" value="<!--{$one.cto}-->" type="text" class="b11" id="textfield3" size="20" /></td>
                      <td align="center" bgcolor="#FFFFFF" class="b07"><a href="#" class="editTerm" rel="<!--{$one.id}-->" value="<!--{$one.termname}-->" from="<!--{$one.cfrom}-->" to="<!--{$one.cto}-->">修改</a> | <a href="#" class="delTerm" rel="<!--{$one.id}-->">删除</a></td>
                    </tr>
                    <!--{/foreach}-->
                    <tr>
                      <td align="center" bgcolor="#CDCDCD" class="b12"><a href="#" class="addTerm">+ 新增</a></td>
                    </tr>
                  </table></td>
              </tr>
            </table></td>
        </tr>
        
        
        
        
        <tr>
          <td>
          <span style="font-size: 14px; font-weight: bold; color: #066;">教育目的条目：</span>
          <table width="864" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#dfdfdf" >
              <tr>
                <td width="856" align="center" bgcolor="#FFFFFF"><table width="95%" border="0" align="center" cellpadding="3" cellspacing="1" bgcolor="#DDDDDD"  style=" margin:20px;">
                    <tr>
                      <td height="25" align="center" bgcolor="#f7f7f7" class="b05">编号</td>
                      <td width="300" height="25" align="center" bgcolor="#f7f7f7" class="b05">目的内容</td>
                      <td width="280" align="center" bgcolor="#f7f7f7" class="b05">选择操作</td>
                    </tr>
                    <!--{foreach from=$config01 item=one}-->
                    <tr class="table_eachline">
                      <td height="30" align="center" bgcolor="#FFFFFF" class="b12"><!--{$one.id}--></td>
                      <td bgcolor="#FFFFFF" class="b15"><input readonly="readonly" name="rename_user" value="<!--{$one.value}-->" type="text" class="b11" id="textfield3" size="20" /></td>
                      
                      <td align="center" bgcolor="#FFFFFF" class="b07"><a href="#" class="edit01" rel="<!--{$one.id}-->" value="<!--{$one.value}-->">修改</a> | <a href="#" class="del01" rel="<!--{$one.id}-->">删除</a></td>
                    </tr>
                    <!--{/foreach}-->
                    <tr>
                      <td align="center" bgcolor="#CDCDCD" class="b12"><a href="#" class="add01">+ 新增</a></td>
                    </tr>
                  </table></td>
              </tr>
            </table></td>
        </tr>
        
        
        <tr>
          <td>
          <span style="font-size: 14px; font-weight: bold; color: #066;">活动类型条目：</span>
          <table width="864" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#dfdfdf" >
              <tr>
                <td width="856" align="center" bgcolor="#FFFFFF"><table width="95%" border="0" align="center" cellpadding="3" cellspacing="1" bgcolor="#DDDDDD"  style=" margin:20px;">
                    <tr>
                      <td height="25" width="100" align="center" bgcolor="#f7f7f7" class="b05">编号</td>
                      <td width="150" align="center" bgcolor="#f7f7f7" class="b05">活动类型内容</td>
                      <td width="150" align="center" bgcolor="#f7f7f7" class="b05">教育目的</td>
                      <td width="150" align="center" bgcolor="#f7f7f7" class="b05">属性1</td>
                      <td width="150" align="center" bgcolor="#f7f7f7" class="b05">属性2</td>
                      <td width="280" align="center" bgcolor="#f7f7f7" class="b05">选择操作</td>
                    </tr>
                    <!--{foreach from=$config02 item=one}-->
                    <tr class="table_eachline">
                      <td height="30" align="center" bgcolor="#FFFFFF" class="b12"><!--{$one.id}--></td>
                      <td bgcolor="#FFFFFF" class="b15"><input readonly="readonly" name="rename_user" value="<!--{$one.value}-->" type="text" class="b11" id="textfield3" size="20" /></td>
                      <td bgcolor="#FFFFFF" class="b15"><input readonly="readonly" name="rename_user" value="<!--{$one.cates}-->" type="text" class="b11" id="textfield3" size="20" /></td>
                      <td bgcolor="#FFFFFF" class="b15"><input readonly="readonly" name="rename_user" value="<!--{$one.attr_1}-->" type="text" class="b11" id="textfield3" size="20" /></td>
                      <td bgcolor="#FFFFFF" class="b15"><input readonly="readonly" name="rename_user" value="<!--{$one.attr_2}-->" type="text" class="b11" id="textfield3" size="20" /></td>
                      <td align="center" bgcolor="#FFFFFF" class="b07"><a href="#" class="edit02" rel="<!--{$one.id}-->" value="<!--{$one.value}-->" attr1="<!--{$one.attr_1}-->" attr2="<!--{$one.attr_2}-->">修改</a> | <a href="#" class="del02" rel="<!--{$one.id}-->">删除</a></td>
                    </tr>
                    <!--{/foreach}-->
                    <tr>
                      <td align="center" bgcolor="#CDCDCD" class="b12"><a href="#" class="add02">+ 新增</a></td>
                    </tr>
                  </table></td>
              </tr>
            </table></td>
        </tr>
        
        
        
        <tr>
          <td><img src="resources/images/ke14.gif" width="864" height="5" /></td>
        </tr>
      </table>
  </tr>
  <tr>
    <td><img src="resources/images/bgc03.gif" width="960" height="20" /></td>
  </tr>
</table>
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="b04">
  <tr>
    <td height="80">&nbsp;</td>
  </tr>
</table>
</body>
</html>
